﻿@model Citi.Scheduler.WebUi.Models.LibraryModel

<script type="text/javascript">
    function closeDialogLibrary() {
        $("#divUpdateLibrary").dialog('close');
        clearForm();
    }

    function clearForm() {
        $("#formActionForm").trigger('reset');
    }
</script>

@using (Ajax.BeginForm("ActionForm", "Library", new AjaxOptions { UpdateTargetId = "divIndexLibrary", 
    InsertionMode = InsertionMode.Replace, OnComplete = "closeDialogLibrary" }, new { id = "formActionForm" }))
{
        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

     if (Model != null)
     {
         @Html.HiddenFor(model => model.Id)
     }
    <p>
        <input type="submit" value="Save" />
    </p>
}